<!-- 
* Copyright (C) 2008 Google Enterprise EMEA
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
-->

<%@page contentType="text/html; charset=windows-1252"
        import="oracle.portal.provider.v2.render.PortletRenderRequest"
        import="oracle.portal.provider.v2.http.HttpCommonConstants"
        import="oracle.portal.provider.v2.personalize.NameValuePersonalizationObject"
        import="oracle.portal.provider.v2.render.PortletRendererUtil"
%>

<%
   PortletRenderRequest pReq = (PortletRenderRequest)
      request.getAttribute(HttpCommonConstants.PORTLET_RENDER_REQUEST);
%>
<img src="/gsaportlet/images/Logo_25wht.gif" width="75" height="32"/>

<%-- This page both displays the customization
     form and processes it. Display the form if 
     there is no action parameter, process it
     otherwise --%>

<%
   String actionParam = PortletRendererUtil.getEditFormParameter(pReq);
   String action = request.getParameter(actionParam);
   String title = request.getParameter("gsaportlet_title");
   String gsa_url = request.getParameter("gsa_url");
   String output = request.getParameter("output");
   String client = request.getParameter("client");
   String proxystylesheet = request.getParameter("proxystylesheet");
   String site = request.getParameter("site");
   NameValuePersonalizationObject data = (NameValuePersonalizationObject)
       PortletRendererUtil.getEditData(pReq);

   // Cancel automatically redirects to the page, so
   // will only recieve OK or APPLY
   if (action != null)
   {
       data.setPortletTitle(title);
       data.putString("gsa_url", gsa_url);
       data.putString("output", output);
       data.putString("client", client);
       data.putString("proxystylesheet", proxystylesheet);
       data.putString("site", site);
       PortletRendererUtil.submitEditData(pReq, data);
       return;
   }

   // Otherwise just render the form.
   title = data.getPortletTitle();
   gsa_url = data.getString("gsa_url");
   output = data.getString("output");
   client = data.getString("client");
   proxystylesheet = data.getString("proxystylesheet");
   site = data.getString("site");
%>
<table border="0" width="439">
  <tr>
    <td width="20%">
      <p align="right">Title:</p>
    </td>
    <td width="80%">
      <input type="TEXT" name="gsaportlet_title" value="<%= title %>">
    </td>
  <tr>
    <td width="20%">
      <p align="right">GSA URL:</p>
    </td>
    <td width="80%">
      <input type="TEXT" name="gsa_url" value="<%= gsa_url %>">
    </td>
  </tr>
    <tr>
    <td width="20%">
      <p align="right">Output:</p>
    </td>
    <td width="80%">
      <input type="TEXT" name="output" value="<%= output %>">
    </td>
  </tr>
  </tr>
    <tr>
    <td width="20%">
      <p align="right">Client:</p>
    </td>
    <td width="80%">
      <input type="TEXT" name="client" value="<%= client %>">
    </td>
  </tr>
  </tr>
    <tr>
    <td width="20%">
      <p align="right">Proxy Style Sheet:</p>
    </td>
    <td width="80%">
      <input type="TEXT" name="proxystylesheet" value="<%= proxystylesheet %>">
    </td>
  </tr>  
    </tr>
    <tr>
    <td width="20%">
      <p align="right">Site:</p>
    </td>
    <td width="80%">
      <input type="TEXT" name="site" value="<%= site %>">
    </td>
  </tr>
</table>